/**
 * 用户相关验证
 */

/**
 * 登录状态验证
 * @param req
 * @param res
 * @param next
 * @returns {*}
 */
exports.loginAuth = function(req, res, next) {
    req.session.user = {
        userId: '564953a0be0639f276cfe855'
    };
    var session = req.session;

    if(!session || !session.user) {
        var msg = '当前未登录状态，就只能到此为止了！';

        console.error(msg);

        return res.send({
            success: false,
            msg: msg
        });
    }

    next();
};